<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users_basic', function (Blueprint $table) {
            $table->increments('id')->comment('用户ID');
            $table->string('account', 20)->unique()->comment('用户登陆账号');
            $table->string('realname', 20)->nullable()->comment('用户姓名');
            $table->string('head', 256)->default('/storage/head.gif')->comment('用户头像');
            $table->string('password')->comment('登陆密码');
            $table->unsignedInteger('qq')->nullable()->comment('用户QQ号');
            $table->unsignedTinyInteger('role_id')->comment('用户角色ID');
            $table->unsignedTinyInteger('sex')->default(0)->comment('0 未定义 1 男 2 女');
            $table->string('telephone',20)->nullable()->comment('用户固话');
            $table->string('mobilephone',20)->nullable()->comment('用户手机号');
            $table->string('email',60)->nullable()->comment('用户邮箱');
            $table->string('id_card',20)->nullable()->comment('用户身份证号');
            $table->string('weixin',20)->nullable()->comment('用户微信号');
            $table->string('address',256)->nullable()->comment('用户住址');
            $table->enum('status',['1','-1'])->default(1)->comment('是否启用 1是 -1否');
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users_basic');
    }
}
